import requests

def export_annotations(project_id, token,file_path):
    url = f'http://14.29.241.21:50343/api/projects/{project_id}/export'
    headers = {'Authorization': f'Token {token}'}
    params = {'exportType': 'JSON', 'download_all_tasks': 'true'}

    response = requests.get(url, headers=headers, params=params)
    if response.status_code == 200:
        with open(file_path, 'wb') as file:
            file.write(response.content)
        print(f'JSON content exported successfully to {file_path}.')
    else:
        print('Error exporting JSON content.')

# 自定义输入项目ID和令牌
project_id = '414'
token = 'dab1b882a8ebfaf7a1b4a9466e33ef781021e056'
file_path = 'path/to/annotations.json'

_
export_annotations(project_id, token,file_path)